package com.zhongfl.crm.enums.boss;

import lombok.Getter;

/**
 * 应用类型
 * @author 木叶丸
 * @date 2018/6/6
 */
public enum AppType {

    MP("1","微信公众号"),
    CP("2","企业微信"),

    OTHER("0","其他");

    @Getter
    private String  key;
    @Getter
    private String name;

    AppType(String key, String name) {
        this.key = key;
        this.name = name;
    }

    public static AppType getEnumByKey(String key) {
        for (AppType item : AppType.values()) {
            if (item.getKey().equals(key)) {
                return item;
            }
        }
        return OTHER;
    }

}
